﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace Gp.Scripts.Core {
    public class TransitionResult {
        public BattlePlayer NextPlayer { get; private set; }
        public Func<List<BaseUnit>> PlayableUnits { get; internal set; }

        /// <summary>
        /// 大回合是否结束
        /// </summary>
        public bool IsGreatTurnEnd = false;
        public TransitionResult(BattlePlayer nextPlayer) 
        {
            NextPlayer    = nextPlayer;
            PlayableUnits = () => Global.Get<BattleSystem>().BattleSettle.GetUnitsByPlayer(nextPlayer.PlayerNumber).ToList();
        }

        public TransitionResult(BattlePlayer nextPlayer, Func<List<BaseUnit>> allowedUnits) {
            NextPlayer = nextPlayer;
            PlayableUnits = allowedUnits;
        }

        public TransitionResult(BattlePlayer nextPlayer, List<BaseUnit> allowedUnits) : this(nextPlayer, () => allowedUnits) { }
    }
}